package com.qf.controller;

import com.qf.pojo.resp.BaseResp;
import com.qf.service.PayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @author lipengg
 * @date 2021/10/22
 */
@Api(value = "支付",tags = "支付")
@RestController
@RequestMapping("/xcOrderPay")
public class XcPay {


    @Autowired
    private PayService payService;

    @ApiOperation("具体支付")
    @RequestMapping(value = "pay",method = RequestMethod.POST)
    public BaseResp pay(@RequestBody Map map){
        System.out.println("map"+map);
        return payService.isPay(map);
    }

    @ApiOperation("异步回调修改订单状态")
    @RequestMapping(value = "/notifyUrl",method = RequestMethod.GET)
    public BaseResp returnUrl(HttpServletRequest request){
        return payService.isReturnUrl(request);
    }
}
